home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.02 Feb 95 / Yenta / Erics C++ Libraries / Interface Classes / CPPStaticText.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-04  |  1.7 KB  |  67 lines  |  [TEXT/KAHL]

  1. /***************************************************** IMPLEMENTATION
  2.     DATE:    9/20/93
  3.     AUTHOR: Eric R. Rosé
  4.  
  5.     CLASS:  CPPStaticText
  6.     
  7.     SUPERCLASS: CPPObject
  8.     
  9.         This C++ class displays a static text item
  10.     
  11. ********************************************************************/
  12.  
  13. #pragma once
  14.  
  15. #include <CPPVisualObject.h>
  16. #include <Quickdraw.h>
  17.  
  18. extern RGBColor RGBWhite;
  19. extern RGBColor RGBBlack;
  20.  
  21. class CPPStaticText : public CPPVisualObject {
  22. public:
  23.     
  24.             CPPStaticText (CPPWindow *itsWindow, Rect *itsBounds,
  25.                            int StrID, int Font = geneva,
  26.                            int FSize = 9, int FJust = teCenter,
  27.                            int FStyle = normal, 
  28.                            RGBColor *FColor = &RGBBlack,
  29.                            Boolean canBeTarget = FALSE,
  30.                            Boolean active = TRUE, 
  31.                            Boolean visible = TRUE);
  32.             CPPStaticText (CPPWindow *itsWindow, Rect *itsBounds,
  33.                            StringPtr theString, int Font = geneva,
  34.                            int FSize = 9, int FJust = teCenter,
  35.                            int FStyle = normal, 
  36.                            RGBColor *FColor = &RGBBlack,
  37.                            Boolean canBeTarget = FALSE,
  38.                            Boolean active = TRUE, 
  39.                            Boolean visible = TRUE);
  40.             ~CPPStaticText (void);
  41.             
  42.     virtual    char    *ClassName (void);
  43.  
  44.     virtual    void    Draw (void);
  45.     
  46.     virtual    void    MakeVisible (Boolean nowVisible);
  47.     
  48.     virtual    Rect    *GetBounds (void);
  49.  
  50.             void    SetitsString (StringPtr newString, Boolean keepCopy);
  51.             StringPtr    GetitsString (void);
  52.  
  53. protected:
  54.     StringPtr    itemText;
  55.     short        fontID;
  56.     short        fontSize;
  57.     short        fontJust;
  58.     short        fontStyle;
  59.     RGBColor    fontColor;
  60.     Rect        textBounds;
  61.     
  62.     virtual    void    MoveContent (short newH, short newV);
  63.     virtual    void    ResizeContent (short newWidth, short newHeight);
  64.             void    MakeStatText (Rect *itsBounds, short Font, short FSize,
  65.                                    short FJust, short FStyle,
  66.                                    RGBColor *FColor);
  67. };